-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(utils): use test instead of indexof in stacktrace #7417
Conversation
size-limit report 📦
|
packages/utils/src/stacktrace.ts
Outdated
.reverse(); | ||
return localStack.map(frame => ({ | ||
...frame, | ||
filename: frame.filename || localStack[0].filename, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit puzzled why this has a fallback to localStack[0].filename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure - this seems strange to me, and feels wrong. Shouldn't we just drop the filename if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is what I would assume. It seems like we were defaulting to the file at the root of the stack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess for now let's just keep the behaviour, but I'll make a TODO to come back and investigate this.
OK, I'm having some trouble with fixing this test... Even if I revert my implementation back to the original it still fails locally? I'm not entirely sure why this would be the case or if I'm maybe using this wrongly? I noticed that since the test depends on a different package I wanted to rebuild the package however I still cant see any logs 😢 |
678dcce
to
e4e9db2
Compare
Let's merge this in for now and come back to take a look at the filename. |
We dont require the actual index + we can match with a single fn call